﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinQProject;
using LinQProject.Repository;

namespace ServiceProject.EntityService
{
    public class OrderService:DataBaseProcessBase<Order>
    {
        public OrderService(FarmacieDataClassesDataContext database) : base(database)
        {}

        public object InsertOrder(Order order)
        {
            return base.Add(order, "OrderId");
        }

        public IList<Order> GetOrdersInInterval(DateTime dtInit, DateTime dtFinal)
        {
            return base.GetAll(o => o.OrderLaunchedDate.Date >= dtInit.Date && o.OrderLaunchedDate <= dtFinal.Date);
        }

        public IList<Order> GetAllOrders()
        {
            return base.GetAll();
        }
    }
}
